import requests
import time
from bs4 import BeautifulSoup

def read_news(news_block):
    for news in news_block.find_all("a"):
        if not news.has_key('href'):
            continue
    #    print(news)
        title=news.text
        link=news['href']
        print("title:{0}".format(title))
        print("link:{0}".format(link))
    
        link_soup=BeautifulSoup(requests.get(link).text,'html.parser')
        print("content:")
        for content in link_soup.find_all('p'):
            text = content.text
            print(content.text)
        print("")
    
        time.sleep(30)

url='http://www.xinhuanet.com/'
response=requests.get(url)
soup=BeautifulSoup(response.text,'html.parser')

news_focus=soup.find('div',class_='focus-newsText bg-white right')
read_news(news_focus)
news_latest=soup.find('div',class_='latest')
read_news(news_latest)
news_depth=soup.find('div',class_='depth-cont')
read_news(news_depth)
